function _GetHealth (GUID)
	ISetAsUnitID(GUID,"internal");
	local vHealth = UnitHealth("internal");
	ClearUnitID("internal")
	return vHealth
end
function _distance(unit, sourceUnit)
	if not sourceUnit then sourceUnit = "player"; end
	if UnitExists(unit)
	and UnitExists(sourceUnit)
	then
		local X1,Y1,Z1 = IGetLocation(UnitGUID(unit));
		local X2,Y2,Z2 = IGetLocation(UnitGUID(sourceUnit));
		return math.sqrt(((X2-X1)^2)+((Y2-Y1)^2)+((Z2-Z1)^2));
	else 
		return 99999;
	end
end

function GetEnemies(sourceUnit,dist)
	local Nearby = {};
	for i=1,GetTotalObjects(3) do
		local guid = IGetObjectListEntry(i);
		ISetAsUnitID(guid,"internal");
		if UnitCanAttack(sourceUnit,"internal") and _enemyincombat("internal") and not UnitIsDeadOrGhost("internal") and _distance("internal",sourceUnit) <= 1.5+(dist+IGetFloatDescriptor(guid,0x110)) then
			tinsert(Nearby,guid);
		end
	end
	for i=1,GetTotalObjects(4) do
		local guid = IGetObjectListEntry(i);
		ISetAsUnitID(guid,"internal");
		if UnitCanAttack(sourceUnit,"internal") and _enemyincombat("internal") and not UnitIsDeadOrGhost("internal") and _distance("internal",sourceUnit) <= 1.5+(dist+IGetFloatDescriptor(guid,0x110)) then
		tinsert(Nearby,guid);
		end
	end
	return Nearby;
end